home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 333_02 / p090.awk < prev    next >
Text File  |  1989-04-21  |  332b  |  16 lines

  1.  
  2. #   prep1 - prepare countries by continent and pop. den.
  3.  
  4. BEGIN       { FS = "\t+"; tmpname = "tmp.$$$" }
  5.  
  6.         {
  7.         printf("%s:%s:%d:%d:%.1f\n",
  8.                $4, $1, $3, $2, 1000 * $3 / $2) > tmpname
  9.         }
  10.  
  11. END        {
  12.         close(tmpname)
  13.         system(sprintf("sort < %s", tmpname))
  14.         system(sprintf("del %s", tmpname))
  15.         }
  16.